/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022.
 * Description: add stage2 memory managemet
 * Author: lilinjie8 <lilinjie8@huawei.com>
 * Create: 2022-01-24
 */

#ifndef HPVISOR_MMU_H
#define HPVISOR_MMU_H
#include <linux/types.h>
#include <linux/kvm_host.h>

struct hpvisor_s2_map {
	u64 gpa;
	u64 hva;
	u32 size;
	u32 flags;
};

extern int hpvisor_delete_memslot(struct kvm *kvm, const struct kvm_userspace_memory_region *mem,
	struct kvm_memory_slot *old, int as_id);

int hpvisor_arch_ioctl_stage2_map(struct kvm *kvm, u64 arg);
int hpvisor_arch_ioctl_stage2_unmap(struct kvm *kvm, u64 arg);
int hpvisor_arch_do_stage2_map(struct kvm *kvm, struct hpvisor_s2_map *sm);
#endif
